<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
  </head>

  <body>
    <a href="https://www.baidu.com">跳转</a>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script>
      // 获取
      console.log($('a').attr('href')) // https://www.baidu.com
      // 设置
      $('a').attr('href', 'https://www.ip.top/')
    </script>
  </body>
</html>
